﻿using System;
using Snake.Gameplay.EffectComponents;

namespace Snake.Gameplay
{
    public static class GameplayFactory
    {
        public static GameplayEffectSpec CreateEffectSpec(GameplayEffect effect)
        {
            if (effect.TryGetComponent(out AssetTags com) && string.IsNullOrEmpty(com.CombinedTags[0]))
            {
                throw new NotSupportedException("Effect tag is null.");
            }

            return new GameplayEffectSpec(effect);
        }

        public static GameplayCueSpec CreateCueSpec(GameplayCue cue)
        {
            return new GameplayCueSpec(cue);
        }

        public static GameplayAbilitySpec CreateAbilitySpec(GameplayAbility ability)
        {
            return new GameplayAbilitySpec(ability);
        }
    }
}